package programer.interviewer;

public class Question1 {

    public boolean isUnique(String astr) {
        if(astr.length() > 100) {
            return false;
        }
        int[] bitmap = new int[26];
        for (int i = 0 ;i< 26; i++) {
            System.out.println("bitmap [" + i  + " ] " + bitmap[i]);
        }

        for(int i = 0; i < astr.length(); i++) {
            int value = astr.charAt(i) - 'a';
            bitmap[value] ++;
        }

        for(int i =0 ;i<26;i++) {
            if(bitmap[i] >1) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
       boolean isUnique =  new Question1().isUnique("leetcode");
       System.out.println(" isUnique:" + isUnique);
    }
}
